//******************************************************************************
//this code is protected by the GNU affero GPLv3
//author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com>
//                        <digital.ragnarok AT gmail dot com>
//******************************************************************************
#include "globals.h"

static u8 get_shell_surface(struct client *c,struct msg *m)
{
  s8 r;
  if(m->req_dws<4){
    PERR("client(%d):fatal:shell::get_shell_surface missing data\n",c->so);
    r=LWL_ERR;goto exit;
  }

  LOG_WIRE("client(%d):shell::get_shell_surface shell_surface_id=%u"
                                  " surface_id=%u\n",c->so,m->req[2],m->req[3]);

  r=shell_get_shell_surface(c,m->req[2],m->req[3]);
exit:
  return r;
}

s8 wl_shell_req(struct client *c,struct msg *m)
{
  s8 r;
  switch(m->req_op){
  case WL_SHELL_GET_SHELL_SURFACE:
    r=get_shell_surface(c,m);
    break;
  default:
    PERR("client(%d):fatal:shell unknown opcode %u\n",c->so,m->req_op);
    r=LWL_ERR;
  };
  return r;
}
